#ifndef QTAB_UI_LOGIC_H
#define QTAB_UI_LOGIC_H

#include <QObject>
#include "Manga_ui.h"
#include "PptpClient.h"
#include "Product.h"
#include "globals.h"
#include "qtab_ui.h"
class QTabUiLogic : public QObject
{
    Q_OBJECT

public:
    explicit QTabUiLogic(QTabUi *ui, EventGridWidget *gridWidget, QObject *parent = nullptr);
    QTabWidget *getTabWidget();
    ~QTabUiLogic();

private slots:
    void onTabCurrentChanged(int index);
    void onTabCloseRequested(int index);
    void onSearchButtonClicked_Manga();
    void onSearchButtonClicked_ZhouBian();
    void onMangaProductListResponse(PptpMessage responseMessage);
    void onZhoubianProductListResponse(PptpMessage responseMessage);

private:
    QTabUi *ui;
    QTabWidget *m_tabWidget;
    PptpClient pptpclient;
    PptpMessage requestMessage;
    void MangaProductList();
    void ZhouBianProductList();
    void displayMangaProductList();
    void displayzhoubianProductList();

    EventGridWidget *gridWidget;
};

#endif // QTAB_UI_LOGIC_H
